import Vue from "vue";
import Vuex from "vuex";
// import login from "./login";

Vue.use(Vuex);
export default new Vuex.Store({
  state: {
    login: JSON.parse(localStorage.getItem("userInfo")) || {
      name: "",
      password: ""
    },
  },
  mutations: {
    updateLogin(state, value) {
      state.login.password = value;
      localStorage.setItem('userInfo', JSON.stringify(state.login))
    },
    update(state, value) {
      state.login = value;
    },
    updateChange(state, value) {
      state.login.integration = value;
      localStorage.setItem('userInfo', JSON.stringify(state.login))
    }
  },
  actions: {},
  modules: {
    // login //声明
  }
});
